package com.bangda.crm.service.impl;

import java.util.List;

import com.bangda.crm.domain.vo.ChartVo;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bangda.crm.mapper.CrmStockMoveMapper;
import com.bangda.crm.domain.CrmStockMove;
import com.bangda.crm.service.ICrmStockMoveService;

/**
 * 库存异动Service业务层处理
 * 
 * @author fbs
 * @date 2024-07-11
 */
@Service
public class CrmStockMoveServiceImpl implements ICrmStockMoveService 
{
    @Autowired
    private CrmStockMoveMapper crmStockMoveMapper;

    /**
     * 查询库存异动
     * 
     * @param 
stockMoveId 库存异动主键
     * @return 库存异动
     */
    @Override
    public CrmStockMove selectCrmStockMoveBystockMoveId(Long stockMoveId)
    {
        return crmStockMoveMapper.selectCrmStockMoveBystockMoveId(stockMoveId);
    }

    /**
     * 查询库存异动列表
     * 
     * @param crmStockMove 库存异动
     * @return 库存异动
     */
    @Override
    public List<CrmStockMove> selectCrmStockMoveList(CrmStockMove crmStockMove)
    {
        return crmStockMoveMapper.selectCrmStockMoveList(crmStockMove);
    }

    /**
     * 新增库存异动
     * 
     * @param crmStockMove 库存异动
     * @return 结果
     */
    @Override
    public int insertCrmStockMove(CrmStockMove crmStockMove)
    {
        crmStockMove.setCreateTime(DateUtils.getNowDate());
        return crmStockMoveMapper.insertCrmStockMove(crmStockMove);
    }

    /**
     * 修改库存异动
     * 
     * @param crmStockMove 库存异动
     * @return 结果
     */
    @Override
    public int updateCrmStockMove(CrmStockMove crmStockMove)
    {
        crmStockMove.setUpdateTime(DateUtils.getNowDate());
        return crmStockMoveMapper.updateCrmStockMove(crmStockMove);
    }

    /**
     * 批量删除库存异动
     * 
     * @param 
stockMoveIds 需要删除的库存异动主键
     * @return 结果
     */
    @Override
    public int deleteCrmStockMoveBystockMoveIds(Long[] stockMoveIds)
    {
        return crmStockMoveMapper.deleteCrmStockMoveBystockMoveIds(stockMoveIds);
    }

    /**
     * 删除库存异动信息
     * 
     * @param 
stockMoveId 库存异动主键
     * @return 结果
     */
    @Override
    public int deleteCrmStockMoveBystockMoveId(Long stockMoveId)
    {
        return crmStockMoveMapper.deleteCrmStockMoveBystockMoveId(stockMoveId);
    }

    @Override
    public List<ChartVo> getChart() {
        return crmStockMoveMapper.getChartVo();
    }

    @Override
    public List<ChartVo> getStokeChart() {
        return crmStockMoveMapper.getStokeChart();
    }
}
